From 741d10ca4fcb835e134a4ab84c7833dd2577b2c5 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sat, 23 Oct 2010 17:01:58 +0900 Subject: [PATCH] Adding initial code skeleton for GtkCellAreaBox. --- gtk/Makefile.am | 2 + gtk/gtkcellarea.c | 138 +++++++++--------- gtk/gtkcellarea.h | 110 +++++++-------- gtk/gtkcellareabox.c | 327 +++++++++++++++++++++++++++++++++++++++++++ gtk/gtkcellareabox.h | 71 ++++++++++ 5 files changed, 524 insertions(+), 124 deletions(-) create mode 100644 gtk/gtkcellareabox.c create mode 100644 gtk/gtkcellareabox.h diff --git a/gtk/Makefile.am b/gtk/Makefile.am index cc02f2c353..eae08f0100 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -169,6 +169,7 @@ gtk_public_h_sources = \ gtkbutton.h \ gtkcalendar.h \ gtkcellarea.h \ + gtkcellareabox.h \ gtkcelleditable.h \ gtkcelllayout.h \ gtkcellrenderer.h \ @@ -432,6 +433,7 @@ gtk_base_c_sources = \ gtkbutton.c \ gtkcalendar.c \ gtkcellarea.c \ + gtkcellareabox.c \ gtkcelleditable.c \ gtkcelllayout.c \ gtkcellrenderer.c \ diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c index a1bdb046fe..cb85f5a7a8 100644 --- a/gtk/gtkcellarea.c +++ b/gtk/gtkcellarea.c @@ -63,27 +63,27 @@ gtk_cell_area_init (GtkCellArea *area) } static void -gtk_cell_area_class_init (GtkCellAreaClass *klass) +gtk_cell_area_class_init (GtkCellAreaClass *class) { /* general */ - klass->add = NULL; - klass->remove = NULL; - klass->forall = NULL; - klass->event = NULL; - klass->render = NULL; + class->add = NULL; + class->remove = NULL; + class->forall = NULL; + class->event = NULL; + class->render = NULL; /* attributes */ - klass->attribute_connect = NULL; - klass->attribute_disconnect = NULL; - klass->attribute_apply = NULL; - klass->attribute_forall = NULL; + class->attribute_connect = NULL; + class->attribute_disconnect = NULL; + class->attribute_apply = NULL; + class->attribute_forall = NULL; /* geometry */ - klass->get_request_mode = NULL; - klass->get_preferred_width = NULL; - klass->get_preferred_height = NULL; - klass->get_preferred_height_for_width = gtk_cell_area_real_get_preferred_height_for_width; - klass->get_preferred_width_for_height = gtk_cell_area_real_get_preferred_width_for_height; + class->get_request_mode = NULL; + class->get_preferred_width = NULL; + class->get_preferred_height = NULL; + class->get_preferred_height_for_width = gtk_cell_area_real_get_preferred_height_for_width; + class->get_preferred_width_for_height = gtk_cell_area_real_get_preferred_width_for_height; } @@ -237,15 +237,15 @@ void gtk_cell_area_add (GtkCellArea *area, GtkCellRenderer *renderer) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_CELL_RENDERER (renderer)); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->add) - klass->add (area, renderer); + if (class->add) + class->add (area, renderer); else g_warning ("GtkCellAreaClass::add not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -255,15 +255,15 @@ void gtk_cell_area_remove (GtkCellArea *area, GtkCellRenderer *renderer) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_CELL_RENDERER (renderer)); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->remove) - klass->remove (area, renderer); + if (class->remove) + class->remove (area, renderer); else g_warning ("GtkCellAreaClass::remove not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -274,15 +274,15 @@ gtk_cell_area_forall (GtkCellArea *area, GtkCellCallback callback, gpointer callback_data) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (callback != NULL); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->forall) - klass->forall (area, callback, callback_data); + if (class->forall) + class->forall (area, callback, callback_data); else g_warning ("GtkCellAreaClass::forall not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -294,17 +294,17 @@ gtk_cell_area_event (GtkCellArea *area, GdkEvent *event, const GdkRectangle *cell_area) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_val_if_fail (GTK_IS_CELL_AREA (area), 0); g_return_val_if_fail (GTK_IS_WIDGET (widget), 0); g_return_val_if_fail (event != NULL, 0); g_return_val_if_fail (cell_area != NULL, 0); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->event) - return klass->event (area, widget, event, cell_area); + if (class->event) + return class->event (area, widget, event, cell_area); g_warning ("GtkCellAreaClass::event not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -317,17 +317,17 @@ gtk_cell_area_render (GtkCellArea *area, GtkWidget *widget, const GdkRectangle *cell_area) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (cr != NULL); g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (cell_area != NULL); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->render) - klass->render (area, cr, widget, cell_area); + if (class->render) + class->render (area, cr, widget, cell_area); else g_warning ("GtkCellAreaClass::render not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -341,16 +341,16 @@ gtk_cell_area_attribute_connect (GtkCellArea *area, const gchar *attribute, gint id) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_CELL_RENDERER (renderer)); g_return_if_fail (attribute != NULL); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->attribute_connect) - klass->attribute_connect (area, renderer, attribute, id); + if (class->attribute_connect) + class->attribute_connect (area, renderer, attribute, id); else g_warning ("GtkCellAreaClass::attribute_connect not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -362,16 +362,16 @@ gtk_cell_area_attribute_disconnect (GtkCellArea *area, const gchar *attribute, gint id) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_CELL_RENDERER (renderer)); g_return_if_fail (attribute != NULL); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->attribute_disconnect) - klass->attribute_disconnect (area, renderer, attribute, id); + if (class->attribute_disconnect) + class->attribute_disconnect (area, renderer, attribute, id); else g_warning ("GtkCellAreaClass::attribute_disconnect not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -382,15 +382,15 @@ gtk_cell_area_attribute_apply (GtkCellArea *area, gint id, GValue *value) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (G_IS_VALUE (value)); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->attribute_apply) - klass->attribute_apply (area, id, value); + if (class->attribute_apply) + class->attribute_apply (area, id, value); else g_warning ("GtkCellAreaClass::attribute_apply not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -402,16 +402,16 @@ gtk_cell_area_attribute_forall (GtkCellArea *area, GtkCellAttributeCallback callback, gpointer user_data) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_CELL_RENDERER (renderer)); g_return_if_fail (callback != NULL); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->attribute_forall) - klass->attribute_forall (area, renderer, callback, user_data); + if (class->attribute_forall) + class->attribute_forall (area, renderer, callback, user_data); else g_warning ("GtkCellAreaClass::attribute_forall not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -422,15 +422,15 @@ gtk_cell_area_attribute_forall (GtkCellArea *area, GtkSizeRequestMode gtk_cell_area_get_request_mode (GtkCellArea *area) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_val_if_fail (GTK_IS_CELL_AREA (area), GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->get_request_mode) - return klass->get_request_mode (area); + if (class->get_request_mode) + return class->get_request_mode (area); g_warning ("GtkCellAreaClass::get_request_mode not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -444,15 +444,15 @@ gtk_cell_area_get_preferred_width (GtkCellArea *area, gint *minimum_size, gint *natural_size) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_WIDGET (widget)); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->get_preferred_width) - klass->get_preferred_width (area, widget, minimum_size, natural_size); + if (class->get_preferred_width) + class->get_preferred_width (area, widget, minimum_size, natural_size); else g_warning ("GtkCellAreaClass::get_preferred_width not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -465,13 +465,13 @@ gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area, gint *minimum_height, gint *natural_height) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_WIDGET (widget)); - klass = GTK_CELL_AREA_GET_CLASS (area); - klass->get_preferred_height_for_width (area, widget, width, minimum_height, natural_height); + class = GTK_CELL_AREA_GET_CLASS (area); + class->get_preferred_height_for_width (area, widget, width, minimum_height, natural_height); } void @@ -480,15 +480,15 @@ gtk_cell_area_get_preferred_height (GtkCellArea *area, gint *minimum_size, gint *natural_size) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_WIDGET (widget)); - klass = GTK_CELL_AREA_GET_CLASS (area); + class = GTK_CELL_AREA_GET_CLASS (area); - if (klass->get_preferred_height) - klass->get_preferred_height (area, widget, minimum_size, natural_size); + if (class->get_preferred_height) + class->get_preferred_height (area, widget, minimum_size, natural_size); else g_warning ("GtkCellAreaClass::get_preferred_height not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (area))); @@ -501,11 +501,11 @@ gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area, gint *minimum_width, gint *natural_width) { - GtkCellAreaClass *klass; + GtkCellAreaClass *class; g_return_if_fail (GTK_IS_CELL_AREA (area)); g_return_if_fail (GTK_IS_WIDGET (widget)); - klass = GTK_CELL_AREA_GET_CLASS (area); - klass->get_preferred_width_for_height (area, widget, height, minimum_width, natural_width); + class = GTK_CELL_AREA_GET_CLASS (area); + class->get_preferred_width_for_height (area, widget, height, minimum_width, natural_width); } diff --git a/gtk/gtkcellarea.h b/gtk/gtkcellarea.h index 20da8c41d3..5da27720d9 100644 --- a/gtk/gtkcellarea.h +++ b/gtk/gtkcellarea.h @@ -88,33 +88,33 @@ struct _GtkCellAreaClass /* vtable - not signals */ /* Basic methods */ - void (* add) (GtkCellArea *area, - GtkCellRenderer *renderer); - void (* remove) (GtkCellArea *area, - GtkCellRenderer *renderer); - void (* forall) (GtkCellArea *area, - GtkCellCallback callback, - gpointer callback_data); - gint (* event) (GtkCellArea *area, - GtkWidget *widget, - GdkEvent *event, - const GdkRectangle *cell_area); - void (* render) (GtkCellArea *area, - cairo_t *cr, - GtkWidget *widget, - const GdkRectangle *cell_area); + void (* add) (GtkCellArea *area, + GtkCellRenderer *renderer); + void (* remove) (GtkCellArea *area, + GtkCellRenderer *renderer); + void (* forall) (GtkCellArea *area, + GtkCellCallback callback, + gpointer callback_data); + gint (* event) (GtkCellArea *area, + GtkWidget *widget, + GdkEvent *event, + const GdkRectangle *cell_area); + void (* render) (GtkCellArea *area, + cairo_t *cr, + GtkWidget *widget, + const GdkRectangle *cell_area); /* Attributes */ - void (* attribute_connect) (GtkCellArea *area, - GtkCellRenderer *renderer, - const gchar *attribute, - gint id); - void (* attribute_disconnect) (GtkCellArea *area, - GtkCellRenderer *renderer, - const gchar *attribute, - gint id); - void (* attribute_apply) (GtkCellArea *area, - gint id, + void (* attribute_connect) (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id); + void (* attribute_disconnect) (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id); + void (* attribute_apply) (GtkCellArea *area, + gint id, GValue *value); void (* attribute_forall) (GtkCellArea *area, GtkCellRenderer *renderer, @@ -122,25 +122,25 @@ struct _GtkCellAreaClass gpointer user_data); /* Geometry */ - GtkSizeRequestMode (* get_request_mode) (GtkCellArea *area); - void (* get_preferred_width) (GtkCellArea *area, - GtkWidget *widget, - gint *minimum_size, - gint *natural_size); - void (* get_preferred_height_for_width) (GtkCellArea *area, - GtkWidget *widget, - gint width, - gint *minimum_height, - gint *natural_height); - void (* get_preferred_height) (GtkCellArea *area, - GtkWidget *widget, - gint *minimum_size, - gint *natural_size); - void (* get_preferred_width_for_height) (GtkCellArea *area, - GtkWidget *widget, - gint height, - gint *minimum_width, - gint *natural_width); + GtkSizeRequestMode (* get_request_mode) (GtkCellArea *area); + void (* get_preferred_width) (GtkCellArea *area, + GtkWidget *widget, + gint *minimum_size, + gint *natural_size); + void (* get_preferred_height_for_width) (GtkCellArea *area, + GtkWidget *widget, + gint width, + gint *minimum_height, + gint *natural_height); + void (* get_preferred_height) (GtkCellArea *area, + GtkWidget *widget, + gint *minimum_size, + gint *natural_size); + void (* get_preferred_width_for_height) (GtkCellArea *area, + GtkWidget *widget, + gint height, + gint *minimum_width, + gint *natural_width); /* Padding for future expansion */ @@ -174,17 +174,17 @@ void gtk_cell_area_render (GtkCellArea const GdkRectangle *cell_area); /* Attributes */ -void gtk_cell_area_attribute_connect (GtkCellArea *area, - GtkCellRenderer *renderer, - const gchar *attribute, - gint id); -void gtk_cell_area_attribute_disconnect (GtkCellArea *area, - GtkCellRenderer *renderer, - const gchar *attribute, - gint id); -void gtk_cell_area_attribute_apply (GtkCellArea *area, - gint id, - GValue *value); +void gtk_cell_area_attribute_connect (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id); +void gtk_cell_area_attribute_disconnect (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id); +void gtk_cell_area_attribute_apply (GtkCellArea *area, + gint id, + GValue *value); void gtk_cell_area_attribute_forall (GtkCellArea *area, GtkCellRenderer *renderer, GtkCellAttributeCallback callback, diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c new file mode 100644 index 0000000000..5c0beddcd0 --- /dev/null +++ b/gtk/gtkcellareabox.c @@ -0,0 +1,327 @@ +/* gtkcellarea.c + * + * Copyright (C) 2010 Openismus GmbH + * + * Authors: + * Tristan Van Berkom + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gtkorientable.h" +#include "gtkcellareabox.h" + +/* GObjectClass */ +static void gtk_cell_area_box_finalize (GObject *object); +static void gtk_cell_area_box_dispose (GObject *object); +static void gtk_cell_area_box_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gtk_cell_area_box_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); + +/* GtkCellAreaClass */ +static void gtk_cell_area_box_add (GtkCellArea *area, + GtkCellRenderer *renderer); +static void gtk_cell_area_box_remove (GtkCellArea *area, + GtkCellRenderer *renderer); +static void gtk_cell_area_box_forall (GtkCellArea *area, + GtkCellCallback callback, + gpointer callback_data); +static gint gtk_cell_area_box_event (GtkCellArea *area, + GtkWidget *widget, + GdkEvent *event, + const GdkRectangle *cell_area); +static void gtk_cell_area_box_render (GtkCellArea *area, + cairo_t *cr, + GtkWidget *widget, + const GdkRectangle *cell_area); + +static void gtk_cell_area_box_attribute_connect (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id); +static void gtk_cell_area_box_attribute_disconnect (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id); +static void gtk_cell_area_box_attribute_apply (GtkCellArea *area, + gint id, + GValue *value); +static void gtk_cell_area_box_attribute_forall (GtkCellArea *area, + GtkCellRenderer *renderer, + GtkCellAttributeCallback callback, + gpointer user_data); + +static GtkSizeRequestMode gtk_cell_area_box_get_request_mode (GtkCellArea *area); +static void gtk_cell_area_box_get_preferred_width (GtkCellArea *area, + GtkWidget *widget, + gint *minimum_width, + gint *natural_width); +static void gtk_cell_area_box_get_preferred_height (GtkCellArea *area, + GtkWidget *widget, + gint *minimum_height, + gint *natural_height); +static void gtk_cell_area_box_get_preferred_height_for_width (GtkCellArea *area, + GtkWidget *widget, + gint width, + gint *minimum_height, + gint *natural_height); +static void gtk_cell_area_box_get_preferred_width_for_height (GtkCellArea *area, + GtkWidget *widget, + gint height, + gint *minimum_width, + gint *natural_width); + + +struct _GtkCellAreaBoxPrivate +{ + GtkOrientation orientation; + + +}; + +enum { + PROP_0, + PROP_ORIENTATION +}; + + +G_DEFINE_TYPE_WITH_CODE (GtkCellAreaBox, gtk_cell_area_box, GTK_TYPE_CELL_AREA, + G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL)); + + +static void +gtk_cell_area_box_init (GtkCellAreaBox *box) +{ + GtkCellAreaBoxPrivate *priv; + + box->priv = G_TYPE_INSTANCE_GET_PRIVATE (box, + GTK_TYPE_CELL_AREA_BOX, + GtkCellAreaBoxPrivate); + priv = box->priv; + + priv->orientation = GTK_ORIENTATION_HORIZONTAL; +} + +static void +gtk_cell_area_box_class_init (GtkCellAreaBoxClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + GtkCellAreaClass *area_class = GTK_CELL_AREA_CLASS (class); + + /* GObjectClass */ + object_class->finalize = gtk_cell_area_box_finalize; + object_class->dispose = gtk_cell_area_box_dispose; + object_class->set_property = gtk_cell_area_box_set_property; + object_class->get_property = gtk_cell_area_box_get_property; + + /* GtkCellAreaClass */ + area_class->add = gtk_cell_area_box_add; + area_class->remove = gtk_cell_area_box_remove; + area_class->forall = gtk_cell_area_box_forall; + area_class->event = gtk_cell_area_box_event; + area_class->render = gtk_cell_area_box_render; + + area_class->attribute_connect = gtk_cell_area_box_attribute_connect; + area_class->attribute_disconnect = gtk_cell_area_box_attribute_disconnect; + area_class->attribute_apply = gtk_cell_area_box_attribute_apply; + area_class->attribute_forall = gtk_cell_area_box_attribute_forall; + + area_class->get_request_mode = gtk_cell_area_box_get_request_mode; + area_class->get_preferred_width = gtk_cell_area_box_get_preferred_width; + area_class->get_preferred_height = gtk_cell_area_box_get_preferred_height; + area_class->get_preferred_height_for_width = gtk_cell_area_box_get_preferred_height_for_width; + area_class->get_preferred_width_for_height = gtk_cell_area_box_get_preferred_width_for_height; + + g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation"); + + + g_type_class_add_private (object_class, sizeof (GtkCellAreaBoxPrivate)); +} + + +/************************************************************* + * GObjectClass * + *************************************************************/ +static void +gtk_cell_area_box_finalize (GObject *object) +{ + G_OBJECT_CLASS (gtk_cell_area_box_parent_class)->finalize (object); +} + +static void +gtk_cell_area_box_dispose (GObject *object) +{ + G_OBJECT_CLASS (gtk_cell_area_box_parent_class)->dispose (object); +} + +static void +gtk_cell_area_box_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + +} + +static void +gtk_cell_area_box_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + +} + + +/************************************************************* + * GtkCellAreaClass * + *************************************************************/ +static void +gtk_cell_area_box_add (GtkCellArea *area, + GtkCellRenderer *renderer) +{ + +} + +static void +gtk_cell_area_box_remove (GtkCellArea *area, + GtkCellRenderer *renderer) +{ + +} + +static void +gtk_cell_area_box_forall (GtkCellArea *area, + GtkCellCallback callback, + gpointer callback_data) +{ + +} + +static gint +gtk_cell_area_box_event (GtkCellArea *area, + GtkWidget *widget, + GdkEvent *event, + const GdkRectangle *cell_area) +{ + + + return 0; +} + +static void +gtk_cell_area_box_render (GtkCellArea *area, + cairo_t *cr, + GtkWidget *widget, + const GdkRectangle *cell_area) +{ + +} + +static void +gtk_cell_area_box_attribute_connect (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id) +{ + +} + +static void +gtk_cell_area_box_attribute_disconnect (GtkCellArea *area, + GtkCellRenderer *renderer, + const gchar *attribute, + gint id) +{ + +} + +static void +gtk_cell_area_box_attribute_apply (GtkCellArea *area, + gint id, + GValue *value) +{ + +} + +static void +gtk_cell_area_box_attribute_forall (GtkCellArea *area, + GtkCellRenderer *renderer, + GtkCellAttributeCallback callback, + gpointer user_data) +{ + +} + + +static GtkSizeRequestMode +gtk_cell_area_box_get_request_mode (GtkCellArea *area) +{ + GtkCellAreaBox *box = GTK_CELL_AREA_BOX (area); + GtkCellAreaBoxPrivate *priv = box->priv; + + return (priv->orientation) == GTK_ORIENTATION_HORIZONTAL ? + GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH : + GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT; +} + +static void +gtk_cell_area_box_get_preferred_width (GtkCellArea *area, + GtkWidget *widget, + gint *minimum_width, + gint *natural_width) +{ + +} + +static void +gtk_cell_area_box_get_preferred_height (GtkCellArea *area, + GtkWidget *widget, + gint *minimum_height, + gint *natural_height) +{ + + +} + +static void +gtk_cell_area_box_get_preferred_height_for_width (GtkCellArea *area, + GtkWidget *widget, + gint width, + gint *minimum_height, + gint *natural_height) +{ + +} + +static void +gtk_cell_area_box_get_preferred_width_for_height (GtkCellArea *area, + GtkWidget *widget, + gint height, + gint *minimum_width, + gint *natural_width) +{ + +} + +/************************************************************* + * API * + *************************************************************/ diff --git a/gtk/gtkcellareabox.h b/gtk/gtkcellareabox.h new file mode 100644 index 0000000000..1e188cecb2 --- /dev/null +++ b/gtk/gtkcellareabox.h @@ -0,0 +1,71 @@ +/* gtkcellareabox.h + * + * Copyright (C) 2010 Openismus GmbH + * + * Authors: + * Tristan Van Berkom + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __GTK_CELL_AREA_BOX_H__ +#define __GTK_CELL_AREA_BOX_H__ + +#include + +G_BEGIN_DECLS + +#define GTK_TYPE_CELL_AREA_BOX (gtk_cell_area_box_get_type ()) +#define GTK_CELL_AREA_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBox)) +#define GTK_CELL_AREA_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBoxClass)) +#define GTK_IS_CELL_AREA_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX)) +#define GTK_IS_CELL_AREA_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_BOX)) +#define GTK_CELL_AREA_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBoxClass)) + +typedef struct _GtkCellAreaBox GtkCellAreaBox; +typedef struct _GtkCellAreaBoxClass GtkCellAreaBoxClass; +typedef struct _GtkCellAreaBoxPrivate GtkCellAreaBoxPrivate; + +struct _GtkCellAreaBox +{ + GtkCellArea parent_instance; + + GtkCellAreaBoxPrivate *priv; +}; + +struct _GtkCellAreaBoxClass +{ + GtkCellAreaClass parent_class; + + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +}; + +GType gtk_cell_area_box_get_type (void) G_GNUC_CONST; + + + +G_END_DECLS + +#endif /* __GTK_CELL_AREA_BOX_H__ */ -- 2.30.2